home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.lang.c++,comp.lang.c,comp.std.c
- Subject: Re: Hungarian notation
- Date: Sat, 27 Jan 1996 17:52:22 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4edore$sh1@fountain.mindlink.net>
- References: <30C40F77.53B5@swsbbs.com> <JSA.96Jan26175507@organon.com> <31098190.8106176@nntp.ix.netcom.com> <4eco1g$aih@fountain.mindlink.net> <4ecqkn$p1t@solutions.solon.com>
- NNTP-Posting-Host: line125.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- seebs@solutions.solon.com (Peter Seebach) wrote:
-
- >In article <4eco1g$aih@fountain.mindlink.net>,
- >Gene Wirchenko <genew@mindlink.bc.ca> wrote:
-
- My paragraphs are >> in this article. I responded to not wrote
- the next paragraph.
-
- >>>I claim that ISO 6.2.1.2 requires that an implementation actually do
- >>>such a conversion. The implementor may choose the mapping. Beside
- >>>the usual throwing away of high order bits, possibilities include
- >>>always using the value 0, or the largest possible value for the new
- >>>type, or, even, a random value.
-
- >> Implementation defined means implementation defined, not what you
- >>want it to mean. I agree that your interpretation sets out reasonable
- >>actions that might be performed. Please quote chapter and verse on
- >>where the Standard states that implementation defined actions must be
- >>"reasonable" (whatever the hell that is <G>).
-
- >Ahh, but there is the key.
-
- >My understanding (and I believe this is Mike's point) is that there is
- >a different between implementation defined *BEHAVIOR* and an implementation
- >defined *RESULT*.
-
- >My understanding is that integer conversions are an implementation
- >defined *RESULT*. No other *behavior* is allowed - the semantics do
- >not imply or show any.
-
- Is this defined in the Standard?
-
- >This is as opposed to system(), which has implementation defined *behavior*
- >whenever system(NULL) returns non-zero. In particular, an implementation
- >could provide a command interpreter that interpreted any string as the string
- >to write at the beginning of every block on a disk. Such an implementation
- >would likely do poorly in the marketplace (unless Microsoft marketed it as
- >a new redundant filesystem), but would be legal.
-
- >However, given something where the *result* is implementation defined, I
- >would expect that no unexpected *behavior* was allowed.
-
- A result is a behavior, no?
- Gah, the arguments over wording. Next: "How many angel can dance
- on the end of a C pointer?"
-
- >This is similar to the special case where a failure to return a value from
- >main() results in an undefined *termination status* but is otherwise required
- >to behave sanely; streams must be flushed, et al. (Another ghastly thing
- >in Schildt's C:TCR. He says that fflush will clear the input buffer on
- >input streams. *sigh*.)
-
- fflush(Schildt);
-
- >> Is your claim supported in the Standard? If it isn't, you're
- >>wasting your time. What if the conversion results in overflow?
-
- >The point of explicitly stating that the *result* is imp-defined is to
- >*define the behavior*.
-
- >Note that Appendix G states (wrongly) that a conversion that could overflow
- >results in undefined behavior. This is only true of floating point ->
- >integral conversions. (It is also true of operations other than
- >conversions.)
-
- >> Why are no side effects permitted? Chapter and verse, please.
-
- >Because none are specified. The semantics of the >> operator on signed
- >ints are implementation specified (or is that defined?) but no one would
- >tolerate it formatting disks, because it doesn't say it can, and the
- >wording makes it clear that no extra behavior is expected.
-
- Doesn't none specified mean that the implementation is free to
- play hopscotch with nasal demons?
-
- >> What if the conversion results in overflow?
-
- >This is actually a legitimate question; if conversion is taken to be
- >an operation, then the previously pointed out limit on all arithmetic
- >ops comes into play, and we have full-fleged *undefined behavior* -
- >easily enough to format a disk with.
-
- >> If it is impossible to convert due to sizing, then the "must" is
- >>rather silly, isn't it?
-
- >Not really; it must do *some* conversion, and the conversion must be the
- >obvious one where that applies, and implementation-defined elsewhere.
-
- My point is that if the value can't be represented then it's
- hardly the case that a conversion is being performed. If you consider
- butchering a value to an implementation defined value to be
- conversion, gah.
-
- >>Right Hand of God. So what about your claims! If they can't be
- >>supported by the Standard, forget it. Schildt CLAIMS that void main()
- >>is ok.
-
- >Sadly, I am beginning to doubt that there is a true statement about C he
- >*doesn't* deny somewhere in that book.
-
- That would be too easy!
-
- [sigsnip raised: remainder of message tossed]
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-